<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>App Engine Starter</title>
    {# Replace your logos, this is so no 404's are generated #}
    <link rel="apple-touch-icon" href="{{ static_url(1) }}/img/logo.png" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">

    <!-- Le styles -->
    <link href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" rel="stylesheet">
    {# static_url method helps you with automatic cookieless domain using the version of your app #}
    {# parameter 1 helps you divide the loading into different subdomain #}
    <link href="{{ static_url(1) }}/css/style.css" rel="stylesheet">
</head>

<body>

    <div class="navbar navbar-default navbar-fixed-top" role="navigation">
        <div class="container">

            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              <a class="navbar-brand" href="{{ uri_for('home') }}">App Engine Starter</a>
            </div>

            <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="/">Home</a></li>
                    <li><a href="{{ uri_for('admin-home') }}">Admin</a></li>
                    <!-- Api & Web Services Demo -->
                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            JSONRPC Demo
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="#" class="rpc-btn" data-method="login">Login with OAuth</a></li>
                            <li><a href="#" class="rpc-btn" data-method="is_logged_in">Check if logged in</a></li>
                            <li><a href="#" class="rpc-btn" data-method="logout">Logout</a></li>
                            <li><a href="#" class="rpc-btn" data-method="hello" data-params='{"world": "Test", "limit": 20}'>Named Params</a></li>
                            <li><a href="#" class="rpc-btn" data-method="hello" data-params='["Test", 2]'>Positional Params</a></li>
                            <li><a href="#" class="batch-btn">Batch Requests</a></li>
                            <li><a href="#" class="rpc-btn" data-method="delete_shouts">Delete Shouts Mapper</a></li>
                            <li><a href="#" class="rpc-btn" data-method="sample_error">Raise a Server Error</a></li>
                        </ul>
                    </li>

                    <li class="dropdown">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                            Cloud Endpoints Demo
                            <b class="caret"></b>
                        </a>
                        <ul class="dropdown-menu">
                            <li><a href="#" class="endpoints-btn" data-method="login">Login with OAuth</a></li>
                            <li><a href="#" class="endpoints-btn" data-method="get_email">Get email</a></li>
                            <li><a href="#" class="endpoints-btn" data-method="hello" data-params='{world:"Test", limit: 20}'>Hello List</a></li>
                            <li><a href="#" class="endpoints-btn" data-method="delete_shouts">Delete Shouts Mapper</a></li>
                        </ul>
                    </li>

                    <!-- End Services Demo -->
                </ul>

                <div class="nav-collapse">
                    <ul class="nav navbar-nav navbar-right">
                        {% if user_id %}
                            <li><a href="{{ uri_for('user-logout') }}">Logout</a></li>
                        {% else %}
                            <li><a href="{{ uri_for('user-login') }}">Login</a></li>
                        {% endif %}
                    </ul>
                </div>

            </div>
        </div>
    </div>

    <div id="main-container" class="container">
        {% if messages %}
            {% for message in messages %}
            <div class="alert alert-{{ message[1] if message[1] else 'info' }}">
              <button type="button" class="close" data-dismiss="alert">&times;</button>
              {{ message[0]|safe }}
            </div>
            {% endfor %}
        {% endif %}

        {% block content %}{% endblock %}
    </div> <!-- /container -->

    <div id="footer">
      <div class="container">
        <p class="text-muted">&copy; 2014 altlimit.com</p>
      </div>
    </div>

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>

{# todo remove this part since it's just a demo #}
    <script type="text/javascript">
        var rpcEndpoint = '{{ uri_for('rpc') }}',
            client_id = '{{ endpoints_client_id }}';
    </script>
    <script src="{{ static_url(2) }}/js/demo.js"></script>
    <script src="https://apis.google.com/js/client.js?onload=init"></script>
{# todo end remove demo part#}
</body>
</html>
